package com.java.tutorials.jdk7.fileoperation;

import com.java.tutorials.Constants;

import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;

/**
 * Created by xuzhike on 2016/1/25.
 * http://www.java2s.com/Code/Java/JDK-7/DeleteaPathwithFilesdelete.htm
 * Delete a Path with Files.delete
 */
public class DeleteaPathwithFilesdelete {
    public static void main(String[] args) throws Exception {
        Path newPath = FileSystems.getDefault().getPath(Constants.TEST_PATH+"test");

        Files.delete(newPath);//只能删除空的文件夹
        System.out.println("Directory deleted successfully!");
    }
}
